[SUBROUTINE]
version = 1.14
icon = circle.png
name = _("Circle by Center")
type = circle
help = _("<b>Create a Circle from it's center</b>&#10;Can add a flat")
order = act pv h1 cx al_x cy al_y d h2 f rot h3 opt xa dir s u_s ugc dpt u_dpt ugcd h4 fp fc

[PARAM_ACT]
name = _("Active")
icon = enable.png
type = bool
value = 1

[PARAM_PV]
name = _("Show design")
icon = glasses.png
type = bool
value = 1

[PARAM_H1]
name = _("Coords, size")
type = sub-header

[PARAM_H4]
name = _("Finishing")
type = sub-header

[PARAM_FP]
name = _("Finishing pass")
type = combo
options = _("None=0:Clockwise=2:Clockwise full depth=12:Counter-Clockwise=3:Counter-Clockwise full depth=13")
tool_tip = _("Conventional for better finish")
value = 0
header = h4
icon = finish.png

[PARAM_FC]
name = _("Finishing cut")
header = h4
type = float
minimum_value = 0.0
icon = rect-pocket.png
tool_tip = _("Last finishing cut")
value = 0.04
metric_value = 1.0

[PARAM_CX]
name = _("cX")
type = float
icon = center.png
tool_tip = _("Center of circle")
value = 0.0
metric_value = 0.0
header = h1

[PARAM_AL_X]
name = _("X axis align")
icon = align-x.png
type = combo
options = _("Left=0:Center=1:Right=2")
header = h1
value = 1
tool_tip = _("Define X reference point")

[PARAM_CY]
name = _("cY")
type = float
icon = center.png
tool_tip = _("Center of circle")
value = 0.0
metric_value = 0.0
header = h1

[PARAM_AL_Y]
name = _("Y axis align")
icon = align-y.png
type = combo
options = _("Top=0:Center=1:Bottom=2")
header = h1
value = 1
tool_tip = _("Define Y reference point")

[PARAM_D]
name = _("Diameter")
type = float
minimum_value = 0.0
icon = diameter.png
tool_tip = _("Diameter")
value = 1.5
header = h1
metric_value = 45
not_allowed = 0

[PARAM_H2]
name = _("D flat")
type = sub-header

[PARAM_F]
name = _("Remove")
icon = d-flat.png
type = float
minimum_value = 0.0
tool_tip = _("Height to remove from diameter")
value = 0
metric_value = 0.0
header = h2

[PARAM_ROT]
name = _("Rotation")
type = float
digits = 2
icon = angle.png
tool_tip = _("Rotation of flat")
value = 0.0
header = h2
suffix = &#176;

[PARAM_H3]
name = _("Milling")
type = sub-header

[PARAM_OPT]
name = _("Option")
type = combo
options = _("Inside normal=0:Pocket=1:On the line=2:Outside=3")
icon = g4x.png
tool_tip = _("Select tool path")
value = 0
header = h3

[PARAM_XA]
name = _("Arc lead-out")
type = bool
icon = lead-out.png
tool_tip = _("Not if on the line")
value = 1
header = h3

[PARAM_DIR]
name = _("Direction")
type = combo
options = _("Clockwise=2:Counter-Clockwise=3")
icon = cw-ccw.png
tool_tip = _("Direction of path")
value = 3
header = h3

[PARAM_S]
name = _("Cut start")
type = combo-user
options = _("User defined=0:Surface=1:Half=2:One quarter=3:Three quarter=4:G-Code=5")
icon = surface.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_s=0:ugc=5

[PARAM_U_S]
name = User start
type = float
value = 0.0
metric_value = 0.0
header = h3
hidden = 1

[PARAM_UGC]
name = User gcode
type = gcode
value = 
header = h3
hidden = 1

[PARAM_UGCD]
name = User depth gcode
type = gcode
value =
header = h3
hidden = 1

[PARAM_DPT]
name = _("Cut down to")
type = combo-user
options = _("User defined=0:Through=1:Bottom=2:Half=3:One quarter=4:Three quarter=5:G-Code=6")
icon = depth.png
tool_tip = _("Pre or user defined")
value = 1
header = h3
links = u_dpt=0:ugcd=6

[PARAM_U_DPT]
name = User depth
type = float
value = -0.5
metric_value = -12.0
header = h3
hidden = 1

[DEFINITIONS]
content =
;	<eval>self.include_once(file name here)</eval>

[CALL]
content =
	(begin #sub_name)
	(circle from center author : Fernand Veilleux)
		
	o<#self_id_active> if [#param_act] (if active)
		o<select> CALL [31] [#param_s] [#param_u_s] [#<surface>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugc]
		o<select> CALL [32] [#param_dpt] [#param_u_dpt] [#<bottom_through>] [#<bottom>] [#<surface> - #<wp_depth> / 2] [#<surface> - #<wp_depth> / 4] [#<bottom> + #<wp_depth> / 4] [#param_ugcd]
		
		o<select> CALL [33] [#param_al_x] [#param_d / 2] [0] [-#param_d / 2]
		o<select> CALL [34] [#param_al_y] [-#param_d / 2] [0] [#param_d / 2]
		
		o<circle> CALL [#param_cx + #33] [#param_cy + #34] [#param_d] [#param_f] [#param_rot] [#param_opt] [#param_dir] [#31] [#32] [#param_pv] [#param_fp] [#param_fc] [#param_xa]
		
	o<#self_id_active> endif
	(end #sub_name)
